package com.blb.service.impl;

import com.blb.entity.Menu;
import com.blb.mapper.MenuMapper;
import com.blb.service.IMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Qujiahao
 * @since 2019-11-20
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {

    @Resource
    private MenuMapper menuMapper;

    @Override
    public List<Menu> getMenuByPid(String pid) {
        return menuMapper.getMenuByPid(pid);
    }

    @Override
    public List<Menu> getMenuByUser(String id, String pid) {
        return menuMapper.getMenuByUser(id, pid);
    }

    @Override
    public List<Menu> getMenues(String pid) {
        return menuMapper.getMenues(pid);
    }

    @Override
    public void setrolemenu(Integer id, String menuid) {
        menuMapper.setrolemenu(id, menuid);
    }

    @Override
    public void deleteByid(Integer id) {
        menuMapper.deleteByid(id);
    }

    @Override
    public List<String> getMenuId(Integer id) {
        return menuMapper.getMenuId(id);
    }
}
